#ifndef CSQL_H
#define CSQL_H

#include <map>
#include <list>
#include <QLibrary>

using namespace std;
typedef std::map<std::string, std::string> NODE;
typedef std::list<NODE>  RECORDSET;
class IAnimal
{
public:
    virtual std::string GetValue(std::string &nValue, char dd[]) = 0;
    virtual void GetValue1(std::string &nValue, char dd[]) = 0;
    virtual bool SetValue(std::string &nValue, std::string &dt) = 0;
    virtual void exeSql(std::string &sql) = 0;
    virtual RECORDSET RecordSet(std::string &sql) = 0;
    virtual void delObj() = 0;
};
typedef IAnimal* (*IGETCAT)(std::string pt,std::string);

class CSql
{
public:
    CSql();
    ~CSql();
    std::string GetValue(std::string nValue, std::string &rValue);
    std::string GetValue1(std::string nValue, std::string &rValue);
    std::string GetValue(std::string nValue);

    bool SetValue(std::string nValue, std::string dt);
    void exeSql(std::string sql);
    RECORDSET RecordSet(std::string sql);
private:
    IAnimal *ISql;
    QLibrary dl;
    IGETCAT IGetCat;

};

#endif // CSQL_H
